1. Field of the Invention
This invention relates to computer systems, and more particularly, to circuits for generating flag bits.
2. Description of the Related Art
Modern microprocessors utilize binary shifters for many functions. In many processors, a binary shifter may be in the main execution path (or paths for processors having multiple execution paths). When a shifter is placed in the main execution path, a low gate delay is essential to prevent the shifter from becoming the critical timing path in the execution unit. Advances in binary adders have reduced the delay that adders in the execution unit, thus increasing the relative contribution of the shifter delay. The problem of delay is further compounded by the implementation of wider data paths (e.g., 64 bits).
In processor architectures that utilize shifters in the execution path, the shifters may perform generic functions such as right/left shifts and right/left rotates. Many processor architectures require the operations to be performed on varying data sizes. Often times, flag generation is required with the same timing as the data result with such operations.
In many shifters, the generation of a carry flag dictates its critical timing path since, in a traditional implementation, the shift is performed prior to the generation of the carry flag. In such an implementation, the flag bit is the last bit shifted out in the particular direction of the shift. Once the shift has been completed, the carry flag must be selected from the proper bit position (depending on the size of the data shifted, which may be less than the maximum operand size of the shifter.) and from the most significant bit or least significant bit (depending on the direction of the shift). Typical implementations utilize multiplexers, which may be slow due to the signal path required for the bit that is to be shifted out as the flag bit, and this signal path may vary for different operand sizes and the shift direction. Thus, buffer stages may be required to drive a critical signal (i.e. the signal representing the flag bit) across a long distance.